package leetcode.字符串;

public class 赎金信383 {
    public boolean canConstruct(String ransomNote, String magazine) {
        for (int i = 0; i < ransomNote.length(); i++) {
            char c = ransomNote.charAt(i);
            if(magazine.indexOf(c) == -1)
                return false;
            magazine = magazine.replaceFirst(""+c,"");
        }
        return true;

    }

    public static void main(String[] args) {
        new 赎金信383().canConstruct("aa","ab");
    }
}
